package org.eden.heartbeat.api.jmx;

import org.eden.heartbeat.api.exception.ReportException;
import org.eden.heartbeat.api.model.MachineInfo;

import java.util.Date;

/**
 * The MBean service interface that processes statistics requests.
 *
 * @author trsimoes
 * @version $Revision:$
 */
public interface HeartbeatStatisticsMBean {

    /**
     * Gets the time in milliseconds that a remote machine has been offline.
     *
     * @param machineInfo the remote machine
     * @param startDate the start date
     * @param endDate the end date
     * @return time that a remote machine has been offline
     * @throws org.eden.heartbeat.api.exception.ReportException throw when an error occurs while producing the report.
     */
    public long getOfflineTime(final MachineInfo machineInfo, final Date startDate, final Date endDate)
            throws ReportException;

    /**
     * Gets the time in milliseconds that the configured remote machine has been offline today.
     *
     * @return time that a remote machine has been offline
     * @throws ReportException throw when an error occurs while producing the report.
     */
    public long getTodayOfflineTime() throws ReportException;

    public int getNumberOfOfflinePeriodsToday() throws ReportException;
}
